﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
  <link href="${ctx.resource}/css/shiftform.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <link href="${ctx.resource}/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
  
  <title></title>

</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>

  <%@ include file="/WEB-INF/include/menu.jsp"%>

  <div class="container main-content">

    <div class="panel panel-default beast-panel beast-panel-layout">

      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host}/advertisement">统计管理</a></li>
          <li class="active">运营报表</li>
        </ol>
      </div>

      <div class="panel-body">

        <div class="col-xs-2 beast-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>

		<form action="" name="myForm">
        <div class="col-xs-10 beast-panel-layout-right">

          <div class="beast-breadcrumb-wrapper">
            <div class="beast-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire" title="运营报表"></i>&nbsp;&nbsp;<span>运营报表&nbsp;-&nbsp;广告主统计</span></h2>
            </div>
          </div>
          
          
          <div class="beast-toolbar-wrapper top-margin-20 clearfix">
            <div class="pull-left" style="height: 34px; line-height: 38px; padding-left: 10px;">
              <span>
              
            <c:choose>
		       <c:when test="${period eq 'YEAR'}">
		                          按年统计结果：
		       </c:when>
		       <c:when test="${period eq 'QUARTER'}">
		                         按季统计结果：
		       </c:when>
		       <c:otherwise>
		                         按月统计结果：
		       </c:otherwise>
			</c:choose>
			
			<b style="color: green;">${count}</b>&nbsp;个广告主</span>
			
            </div>
            
            <ul class="nav nav-pills beast-breadcrumb-nav">
              <li class="pull-right ${period eq 'YEAR' ? 'active': ''}"><a href="${ctx.host}/reports/aduser?period=YEAR">按年统计</a></li>
              <li class="pull-right ${period eq 'QUARTER' ? 'active': ''}"><a href="${ctx.host}/reports/aduser?period=QUARTER">按季统计</a></li>
              <li class="pull-right ${period eq 'MONTH' or (empty period) ? 'active': ''}"><a href="${ctx.host}/reports/aduser?period=MONTH">按月统计</a></li>
            </ul>
              
          </div> 
          
          
          <!-- Tab panes -->
          <div class="tab-content">
            <table class="table table-striped table-hover demo2do-table bottom-margin-20">
	            <thead>
	              <tr>
	                <th>广告主名称</th>
	                <th>昵称</th>
	                <th>公司名称</th>
	                <th>联系方式</th>
	                <th>级别</th>
	                <th>注册时间</th>
	                <th>状态</th>
	                <th>操作</th>
	              </tr>
	            </thead>
	            <tbody>
		            <c:forEach var="aduser" items="${adusers}">
	                <tr>
	                  <td>${aduser.profile.userName}</td>
	                  <td>${aduser.profile.nickName}</td>
	                  <td>${aduser.company.name}</td>
	                  <td>${aduser.mobile}</td>
	                  <td>${aduser.profile.aduserLevel.name}</td>
	                  <td><fmt:formatDate value="${aduser.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
	                  
	                  <td><span class="label label-${aduser.status.css}">${aduser.status.description}</span></td>
	                  <td>
	                    <a href="${ctx.host}/reports/aduser/statisticsconverges/${aduser.id}/detail" class="hover-no-text-decoration" title="详情">投放广告</a>
	                  </td>
	                </tr>  
		            </c:forEach>
	            </tbody>
	          </table>
          </div>
          
          <c:choose>
            <c:when test="${not empty queryString}">
              <jsp:include page="/WEB-INF/include/page.jsp">
                <jsp:param name="url" value="reports/aduser" /> 
                <jsp:param name="queryString" value="${queryString}" />
              </jsp:include>
            </c:when>
            <c:otherwise>
              <jsp:include page="/WEB-INF/include/page.jsp">
                <jsp:param name="url" value="reports/aduser" />
              </jsp:include>
            </c:otherwise>
          </c:choose>
        </div>
        </form>

      </div>

    </div>

  </div>

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/shiftform.js"></script>
  <script src="${ctx.resource}/js/select2.min.js"></script>
  <script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap-datetimepicker.js"></script>
  <script src="${ctx.resource}/js/bootstrap-datetimepicker.zh-CN.js"></script>
  

</body>

</html>
